package com.heyqing.topic.MissingNumber_0268;

import java.util.Arrays;

/**
 * ClassName:MissingNumber
 * Package:com.heyqing.topic.MissingNumber_0268
 * Description:
 *
 * @Date:2024/9/25
 * @Author:Heyqing
 */
public class MissingNumber {
    public int missingNumber(int[] nums) {
        Arrays.sort(nums);
        int i;
        for (i = 0; i < nums.length; i++) {
            if (nums[i] != i) return i;
        }
        return i;
    }
}
